home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-07-15 | 3.0 KB | 76 lines | [TEXT/MPS ] |
- //----------------------------------------------------------------------------------------
- // UVolumeBasedApp.h
- // ETO20 MacApp 3.3.1, MPW 3.4.1
- // Copyright ©1996 Conrad Kopala
- // Twist Down Lists version 2.0a0 7/15/96
- //----------------------------------------------------------------------------------------
-
- #ifndef __UVOLUMEBASEDAPP__
- #define __UVOLUMEBASEDAPP__
-
- #ifndef __UVOLUME__
- #include "UVolume.h"
- #endif
-
- // MacApp
- #ifndef __UOBJECT__
- #include "UObject.h"
- #endif
-
- //ToolBox stuff
- //None
-
- //ANSI stuff
- //None
-
-
- // First, read the commentary in UVolume.h because this file exists because I decided
- // it was necessary to use the TVolume object.
- //
- // MVolumeBasedApp contains methods paralleling TApplication's DoMakeFile, ChooseFile,
- // CanOpenDocument, and OpenOld methods. The TApplication versions have been blatantly
- // copied and modified to use a TVolume in place of TFile.
- //
- // One thing done here, is use TVolume::IsHFSVolume to verify that the volume is indeed
- // an HFS volume. If is not, we fail without opening anything and alert the user that he
- // attempted to open a non-HFS volume.
- //
- // Two versions of ChooseVolume and OpenVolume are included. This is an artifact of the
- // development process. The simple versions of ChooseVolume and OpenVolume were written
- // first and then the more complicated versions were written. I saw no reason to remove
- // the old, simple versions of these methods. Sometimes, when trying to find mistakes in
- // a program it is useful to have more than one way of doing something and be able to
- // compare the results. Furthermore, it seems wasteful to throw working methods away - who
- // knows, they might turn out to be useful at a later date.
- //
- // The old versions accept an instance of TVolume while the new versions accept a list of
- // aliases of disks. TOVolumeCommand parallels TODocCommand and uses the new versions.
- // TOpenVolumeCommand uses the old versions. The old versions have not been used for quite
- // some time so use them at your own risk.
- //----------------------------------------------------------------------------------------
- // MVolumeBasedApp
- //----------------------------------------------------------------------------------------
-
- class MVolumeBasedApp
- {
- MA_DECLARE_CLASS;
-
- public:
-
- MVolumeBasedApp::MVolumeBasedApp();
-
- virtual ~MVolumeBasedApp();
-
- TVolume* MVolumeBasedApp::DoMakeVolume(); //analog of DoMakeFile
-
- Boolean MVolumeBasedApp::ChooseVolume(CommandNumber itsCommandNumber, TList** aVolumeList); //analog of ChooseDocument
- Boolean MVolumeBasedApp::ChooseVolume(CommandNumber itsCommandNumber, TVolume** aVolume); //old version
-
- //Note: I could have overloaded CanOpenDocument and left it as a method of TTwistDownApp.
- Boolean MVolumeBasedApp::CanOpenVolume(CommandNumber itsCommandNumber, TVolume* aVolume); //analog of CanOpenDocument
-
- TDocument* MVolumeBasedApp::OpenVolume(CommandNumber itsOpenCommand, TList* aVolumeList); //analog of OpenOld
- TDocument* MVolumeBasedApp::OpenVolume(CommandNumber itsOpenCommand, TVolume* volumeOwnedByDoc); //old version
- };
-
- #endif